package com.java1412.controller;

import com.java1412.dao.db01.UserRepository;
import com.java1412.dao.db02.GoodsRepository;
import com.java1412.entity.Goods;
import com.java1412.entity.Users;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author java1412
 * @create 2021-05-20 15:04
 */
@RestController
public class GoodsController {
    @Autowired
    private UserRepository userRepository;

    @Autowired
    private GoodsRepository goodsRepository;

    @GetMapping(value = "/users")
    public List<Users> users() {
        return userRepository.findAll();
    }

    @GetMapping(value = "/goods")
    public List<Goods> goods() {
        return goodsRepository.findAll();
    }
}

